

class JrDate {
  static String parseTimeYYMMDD(DateTime time) {
    String month = '${time.month}'.padLeft(2, '0');
    String day = '${time.day}'.padLeft(2, '0');
    return '${time.year}-$month-$day';
  }

  static String parseTime(DateTime time) {
    DateTime now = DateTime.now();
    if (time.year == now.year) {
      if (time.month == now.month && time.day == now.day) {
        return '${time.hour}:${time.minute}';
      } else {
        return '${time.month}-${time.day} ${time.hour}:${time.minute}';
      }
    } else {
      return '${time.year}-${time.month}-${time.day} ${time.hour}:${time.minute}';
    }
  }
}